package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.mapper.CustomerNursingProjectMapper;
import com.zzyl.service.CustomerNursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerNursingProjectServiceimpl implements CustomerNursingProjectService {
    @Autowired
    private CustomerNursingProjectMapper customerNursingProjectMapper;


    @Override
    public PageResponse<NursingProjectVo> pageCustomer(String name, Integer pageNum, Integer pageSize, Integer status) {
        PageHelper.startPage(pageNum, pageSize);
        Page<NursingProjectVo> page = customerNursingProjectMapper.pageCustomer(name, status);
        return PageResponse.of(page, NursingProjectVo.class);
    }

    @Override
    public NursingProjectVo getNursing(Long id) {
        NursingProjectVo nursingProjectVo = customerNursingProjectMapper.getNursing(id);
        return nursingProjectVo;
    }
}
